home *** CD-ROM | disk | FTP | other *** search
Wrap
iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333)))) iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333)))) NNNNAAAAMMMMEEEE _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt, _ffff_aaaa_ssss_tttt______iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt - execute a function after a (possibly high resolution) delay SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>> _tttt_oooo_iiii_dddd______tttt _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt_((((_vvvv_oooo_iiii_dddd _((((_****_f_u_n_c_))))_((((_))))_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_,,,, _llll_oooo_nnnn_gggg _t_i_c_k_s_,,,, _pppp_llll______tttt _p_l_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_2_...._...._...._))))_;;;; _tttt_oooo_iiii_dddd______tttt _ffff_aaaa_ssss_tttt______iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt_((((_vvvv_oooo_iiii_dddd _((((_****_f_u_n_c_))))_((((_))))_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_,,,, _llll_oooo_nnnn_gggg _f_a_s_t__t_i_c_k_s_,,,, _pppp_llll______tttt _p_l_,,,, _vvvv_oooo_iiii_dddd _****_a_r_g_2_...._...._...._))))_;;;; AAAArrrrgggguuuummmmeeeennnnttttssss _f_u_n_c Function to execute when the time increment expires. _a_r_g First or only argument to the function. _a_r_g_2... Optional, additional arguments to the function. _t_i_c_k_s Number of (fast or normal) clock ticks to wait before the function is called. _p_l The interrupt priority level at which the function will be called. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN These two functions are nearly identical, the difference being which clock is used. _i_t_i_m_e_o_u_t schedules the function specified by _f_u_n_c to be called after the time interval specified by _t_i_c_k_s, while _f_a_s_t__i_t_i_m_e_o_u_t schedules the function specified by _f_u_n_c to be called after the the number of fast clock ticks specified by _f_a_s_t__t_i_c_k_s. The resolution of the fast clock varies with system type, and with local setup, because it is a tuneable value. It is typically near one millisecond. See the function _f_a_s_t_h_z_t_o(D3) for a standard way to convert from a timeval to fast ticks. Both functions call the function at the interrupt priority level specified by _p_l. The first argument to _f_u_n_c is _a_r_g. If additional arguments are passed following _p_l (varargs), they also are are passed to _f_u_n_c. The call returns immediately without waiting for the specified function to execute. RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss If the function specified by _f_u_n_c is successfully scheduled, _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt returns a non-zero value that can be passed to _uuuu_nnnn_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt to cancel the request. If the function could not be scheduled, _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt returns a value of 0. PPPPaaaaggggeeee 1111 iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333)))) iiiittttiiiimmmmeeeeoooouuuutttt((((DDDD3333)))) UUUUSSSSAAAAGGGGEEEE _p_l must specify a priority level greater than or equal to _p_l_t_i_m_e_o_u_t. Identifiers for priority levels are declared in _s_y_s/_d_d_i._h; _p_l_h_i is the typical value to pass. Note that no matter what value is given for _p_l, other CPUs can be executing kernel code concurrently with the execution of _f_u_n_c, including other instances of the same driver that scheduled _f_u_n_c and even other instances of _f_u_n_c itself. Hence it is essential to use locking to protect critical data. The _t_i_c_k_s argument specifies the number of tick interrupts to pass before the function is called. A _t_i_c_k_s value of 0 is treated as if it were 1. After the specified number of ticks have been counted, the call to _f_u_n_c is deferred until the processor is at base level. The length of time before the function is called is not guaranteed to be exactly equal to the requested time, but will be at least _t_i_c_k_s-1 clock ticks in length. When called, _f_u_n_c may not lower the priority level below _p_l. If _i_t_i_m_e_o_u_t is called holding a lock that is claimed by _f_u_n_c, the caller must hold the lock at a processor level greater than the base processor level. Loadable drivers must use _u_n_t_i_m_e_o_u_t() to cancel any pending timeout functions before unloading; otherwise a kernel panic can result when the no-longer-loaded function is called. A driver that is deallocating a data structure must be careful to cancel any pending timeout function that refers to the data structure. LLLLeeeevvvveeeellll Base or Interrupt. SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function. EEEExxxxaaaammmmpppplllleeeessss See _cccc_oooo_pppp_yyyy_bbbb(D3) for an example of _iiii_tttt_iiii_mmmm_eeee_oooo_uuuu_tttt. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS LOCK_ALLOC(D3), dtimeout(D3), fasthzto(D3), untimeout(D3). PPPPaaaaggggeeee 2222